package cn.edu.ctbu.firsthello.api;


import cn.edu.ctbu.firsthello.domain.Student;
import cn.edu.ctbu.firsthello.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;


@RestController
public class HelloApiController {


    @Autowired
    StudentService studentService;


    @RequestMapping("/hello")
    public String sayHi(){




        return "hello,spring Boot!";
    }

    @RequestMapping("/student/findall")
    public List<Student> findAll(){

        return studentService.findAll();
    }



}
